home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-11 | 6.9 KB | 260 lines | [TEXT/MPS ] |
- /*
- File: DrawContent.h
-
- Contains: CDrawContent, CPartContent, CPartialContent
-
- Written by: Adapted from Selection.h by Mike Halpin.
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- */
-
- // -- DrawEditor Includes --
-
- #ifndef _DRAWCONTENT_
- #define _DRAWCONTENT_
-
- #ifndef _COMPILERDEFS_
- #include "CompDefs.h"
- #endif
-
- #ifndef _DRAWEDITORDEF_
- #include "DrawEditorDef.h"
- #endif
-
- #ifndef _PALETTE_
- #include "Palette.h"
- #endif
-
- // -- OpenDoc Utilities --
-
- #ifndef _ALTPOINT_
- #include "AltPoint.h"
- #endif
-
- //=============================================================================
- // Forward Declarations
- //=============================================================================
- class DrawEditor;
- class CSelection;
- class CShape;
- class CEmbeddingShape;
- class CCloneInfo;
- class CSubscribeLink;
- class CPublishLink;
- class COrderedList;
-
-
- //=============================================================================
- // CDrawContent
- //=============================================================================
- class CDrawContent
- {
- public:
-
- // -- Init --
- CDrawContent(DrawEditor* editor, COrderedList* shapes, COrderedList* pLinks, COrderedList* sLinks);
- CDrawContent(DrawEditor* editor);
- virtual ~CDrawContent();
-
- public:
-
- // -- Accessors --
- DrawEditor* GetDrawEditor() const;
-
- COrderedList* GetShapeList() const;
- COrderedList* GetPublishLinks() const;
- COrderedList* GetSubscribeLinks() const;
-
- // -- Modify Content
- virtual void AddShape(Environment* ev, CShape* shape) = 0;
- virtual void AddShapeToPart(Environment *ev, CShape* shape) = 0;
-
- // -- Embedding --
- virtual CEmbeddingShape* IsOneEmbeddedShape(Environment* ev) const;
-
- // -- Storage --
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* info);
-
- virtual void ExternalizeSingleEmbeddedFrame(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* cloneInfo,
- ODFrame* embeddedFrame);
-
- virtual void Internalize(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* info);
-
- virtual void InternalizeSingleEmbeddedFrame(Environment* ev,
- ODStorageUnit* storageUnit,
- CCloneInfo* info);
-
- virtual void InternalizeForeignContent(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* info);
-
- void HandleInternalizeContent(Environment* ev,
- ODStorageUnit* su,
- CCloneInfo* info);
-
- void HandleTranslateContent(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* info,
- ODBoolean doEmbed);
-
-
- void AddPublishLink(CPublishLink* link);
-
- void AddSubscribeLink(CSubscribeLink* link);
-
- void RemoveSubscribeLink(CSubscribeLink* link);
-
- void RemovePublishLink(CPublishLink* link);
-
-
-
-
- ODULong Count();
- void ExternalizeLinks(Environment *ev, ODStorageUnit *drawSU, CCloneInfo *cloneInfo);
-
- void ExternalizeSingleFrameLinks(Environment *ev, ODStorageUnit *drawSU, CCloneInfo *cloneInfo);
-
- void MergeSingleFrameSubLink( Environment *ev, ODStorageUnit *su, CCloneInfo *info, COrderedList* shapeList, ODULong& offset);
-
- void MergeSingleFramePubLink( Environment *ev, ODStorageUnit *su, CCloneInfo *info, COrderedList* shapeList, ODULong& offset);
-
- void InternalizeSubLinks( Environment *ev, ODStorageUnit *su, CCloneInfo *cloneInfo, CShape** shapeTable);
- void InternalizePubLinks( Environment *ev, ODStorageUnit *su, CCloneInfo *cloneInfo, CShape** shapeTable);
- void InternalizeSingleEmbeddedFrameLinks(Environment* ev, ODStorageUnit* storageUnit, CCloneInfo* cloneInfo);
-
- void PostCloneInternalizeLinks(Environment* ev, CShape* shape);
- virtual void AddPublisherToPart(Environment* ev, CPublishLink* pLink);
-
- virtual void AddSubscriberToPart(Environment* ev, CSubscribeLink* sLink);
-
-
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- protected:
- DrawEditor* fDrawEditor;
- COrderedList* fShapeList;
- COrderedList* fPublishLinks;
- COrderedList* fSubscribeLinks;
-
-
- };
-
- //=============================================================================
- // CPromiseContent
- //=============================================================================
- class CPromiseContent : public CDrawContent
- {
- public:
-
- // -- Init --
- CPromiseContent(DrawEditor* editor, COrderedList* shapeList);
- CPromiseContent(CDrawContent* content);
- virtual ~CPromiseContent();
-
- public:
-
- // -- Storage --
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* cloneInfo);
-
- // -- Content --
- virtual void AddShapeToPart(Environment *ev, CShape* shape);
- virtual void AddShape(Environment *ev, CShape* shape);
-
-
-
- };
-
- //=============================================================================
- // CSubscribeContent
- //=============================================================================
- class CSubscribeContent : public CDrawContent
- {
- public:
- CSubscribeContent(DrawEditor* editor, COrderedList* shapes, CSubscribeLink* subscribeLink);
- virtual ~CSubscribeContent();
-
- public:
-
- virtual void AddShapeToPart(Environment *ev, CShape* shape);
- virtual void AddShape(Environment *ev, CShape* shape);
-
- private:
- CSubscribeLink* fSubscribeLink;
- };
-
-
- //=============================================================================
- // CSelectionContent
- //=============================================================================
- class CSelectionContent : public CDrawContent
- {
- public:
- CSelectionContent(DrawEditor* editor,
- COrderedList* shapes,
- COrderedList* pLinks,
- COrderedList* sLinks,
- CSelection* selection);
- virtual ~CSelectionContent();
-
- public:
-
- // -- Storage --
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* cloneInfo);
-
- // -- Content --
-
- virtual void AddShapeToPart(Environment *ev, CShape* shape);
- virtual void AddShape(Environment *ev, CShape* shape);
- virtual void AddSubscriberToPart(Environment* ev, CSubscribeLink* sLink); //Override
-
-
- private:
- CSelection* fSelection;
-
- };
-
-
- //=============================================================================
- // CPartContent
- //=============================================================================
- class CPartContent : public CDrawContent
- {
- public:
-
- // -- Init --
- CPartContent(DrawEditor* editor, COrderedList* shapes, COrderedList* pLinks, COrderedList* sLinks);
- virtual ~CPartContent();
-
- public:
-
- // -- Storage --
- virtual void Externalize(Environment* ev,
- ODStorageUnit* storage,
- CCloneInfo* cloneInfo);
-
- // -- Content --
-
- virtual void AddShapeToPart(Environment *ev, CShape* shape);
- virtual void Add(Environment* ev, CShape* shape);
- virtual void AddShape(Environment* ev, CShape* shape);
- virtual void AddPublisherToPart(Environment* ev, CPublishLink* pLink); //Override
-
- virtual void AddSubscriberToPart(Environment* ev, CSubscribeLink* sLink); //Override
-
-
- };
-
-
- #endif